
public class TV {
	
	// state / fields / instance variables
		String make;
		String model;
		int year;
		int size;
		int channel;
		boolean power;
		int age;
		
		
		
		void power()
		{
			if (!power) {
			power = true;
		}
			else {
				System.out.println(" TV is already on ");
			}
		}
			
		// Display Information
		void displayInfo()
			{
				System.out.println("TV was built in " + year);
				System.out.println("TV is made by " + make);
			
				if (power) {
					System.out.println("TV is ON");
				}
				else {
					System.out.println("TV is OFF");
				}
			}
			int inscreaseChannelBy1(int numberofChannels){
				
				if (power) {
					channel = channel + numberofChannels;
				}
				else {
					System.out.println(" Please turn on the TV");
				}
				return channel;
			}
			 
			/** This method displays the name of the channel based on the channel
			 *  number if the TV is on, otherwise it will ask you  
			 */
			void displayChannelName(){
				if(power) {
				
				String channelName = "";
				
				switch (channel){
				case 1:
					channelName = "CNN";
					break;

				case 2:
					channelName = "HBO";
					break;
				
				default:
				
					break;
					
				}
				System.out.println(channelName);
			}
			else {
				System.out.println(" Please turn on the TV. ");
			}
			}	
			
			
				Boolean isAgeRestrictedChannel(int age)
				{
					if(age < 16 && channel == 2) {
						System.out.println(" This is an age restricted channel ");
						return true;
					}
					else {
						System.out.println("This is not an age restricted channel");
						return false;
					}
				}
}


		
		
		